import httpRequest from './http';

/**
 * @desc 登录
 * @param params
 * @returns {Promise<unknown>}
 */
export const loginApi = (params) => httpRequest.post('/admin/login', params);
/**
 * @desc 用户列表
 * @param params
 * @returns {*}
 */
export const reqUsersList = (params) => httpRequest.get('/users/list', params);
/**
 * @desc 商品列表
 * @param params
 * @returns {*}
 */
export const reqProductsList = (params) => httpRequest.get('/product/list', params);
/**
 * @desc 店铺列表
 * @param params
 * @returns {Promise<unknown>}
 */
export const reqShopList = (params) => httpRequest.get('/shop/list', params);
/**
 * @desc 获取经纬度地址
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqPoiResearch = (params) => httpRequest.get('/poi/search', params);

/**
 * @desc 创建商铺
 * @param params
 * @returns {*}
 */
export const reqCreateShop = (params) => httpRequest.post('/admin/addShop', params);

/**
 * @desc 创建商品
 * @param params
 * @returns {*}
 */
export const reqCreateProduct = (params) => httpRequest.post('/admin/addProduct', params);
/**
 * @desc 订单列表
 * @param params
 * @returns {*}
 */
export const reqOrderList = (params) => httpRequest.get('/admin/orders', params);
/**
 * @desc 申请列表
 * @param params
 * @returns {*}
 */
export const reqApplyList = (params) => httpRequest.get('/refund/list', params);
/**
 * @desc 同意退款
 * @param params
 * @returns {*}
 */
export const reqRefund = (params) => httpRequest.post('/refund/wxRefund', params);
/**
 * @desc 拒绝退款
 * @param params
 * @returns {*}
 */
export const reqRefundReject = (params) => httpRequest.post('/refund/reject', params);
/**
 * @desc 删除商品
 * @param params
 * @returns {Promise<unknown>}
 */
export const reqDeleteProduct = (params) => httpRequest.delete('/product/delete', params);
/**
 * @desc 商品详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDetailProduct = (params) => httpRequest.get('/product/detail', params);
/**
 * @desc 修改商品
 * @param params
 * @returns {*}
 */
export const reqUpdateProduct = (params) => httpRequest.post('/admin/updateProduct', params);

/**
 * @desc 店铺详情
 * @param params
 * @returns {*}
 */
export const reqDetailShop = (params) => httpRequest.get('/shop/detail', params);
/**
 * @desc 编辑店铺
 * @param params
 * @returns {*}
 */
export const reqUpdateShop = (params) => httpRequest.post('/admin/updateShop', params);

/**
 * @desc 商品分类列表
 * @param params
 * @returns {*}
 */
export const reqGetPcategory = (params) => httpRequest.get('/pcategory/list', params);

/**
 * @desc 创建商品分类
 * @param params
 * @returns {*}
 */
export const reqCreatePcategory = (params) => httpRequest.post('/pcategory/create', params);
/**
 * @desc 修改商品分类
 * @param params
 * @returns {*}
 */
export const reqUpdatePcategory = (params) => httpRequest.post('/pcategory/update', params);
/**
 * @desc 删除商品分类
 * @param params
 * @returns {*}
 */
export const reqDeletePcategory = (params) => httpRequest.delete('/pcategory/delete', params);
/**
 * @desc 商品分类详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqPcategoryDetail = (params) => httpRequest.get('/pcategory/detail', params);


/**
 * @desc 入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqEntryList = (params) => httpRequest.get('/entry/list', params);

/**
 * @desc 新增入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqCreateEntry = (params) => httpRequest.post('/entry/create', params);
/**
 * @desc 修改入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqUpdateEntry = (params) => httpRequest.post('/entry/update', params);
/**
 * @desc 删除入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDeleteEntry = (params) => httpRequest.delete('/entry/delete', params);
/**
 * @desc 入口分类详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDetailEntry = (params) => httpRequest.get('/entry/detail', params);

/**
 * @desc 店铺分类列表
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqShopCategoryList = (params) => httpRequest.get('/shopCategory/list', params);
/**
 * @desc 新建店铺分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqCreateShopCategory = (params) => httpRequest.post('/shopCategory/create', params);
/**
 * @desc 修改店铺分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqUpdateShopCategory = (params) => httpRequest.post('/shopCategory/update', params);
/**
 * @desc 删除店铺分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDeleteShopCategory = (params) => httpRequest.delete('/shopCategory/delete', params);
/**
 * @desc 店铺分类详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDetailShopCategory = (params) => httpRequest.get('/shopCategory/detail', params);
/**
 * @desc 羊品种
 * @param params
 * @returns {*}
 */
export const reqBreedList = (params) => httpRequest.get('/breed/list', params);

/**
 * @desc 领养商品列表
 * @param params
 * @returns {*}
 */
export const reqAdoptProductsList = (params) => httpRequest.get('/product/adopt_list', params);

/**
 * @desc 轮播管理列表
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqFocusList = (params) => httpRequest.get('/banner/list', params);

/**
 * @desc 新增轮播
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqFocusAdd = (params) => httpRequest.post('/banner/create', params);

/**
 * @desc 修改轮播
 * @param params
 * @returns {*}
 */
export const reqFocusEdit = (params) => httpRequest.post('/banner/update', params);

/**
 * @desc 轮播详情
 * @param params
 * @returns {*}
 */
export const reqFocusDetail = (params) => httpRequest.get('/banner/detail', params);

/**
 * @desc 删除轮播
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqFocusDelete = (params) => httpRequest.delete('/banner/delete', params);
/**
 * @desc 文章列表
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqArticleList = (params) => httpRequest.get('/protocol/list', params);
/**
 * @desc 删除文章
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqArticleDelete = (params) => httpRequest.delete('/protocol/delete', params);
/**
 * @desc 编辑文章
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqArticleEdit = (params) => httpRequest.post('/protocol/update', params);
/**
 * @desc 新增文章
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqArticleAdd = (params) => httpRequest.post('/protocol/create', params);
/**
 * @desc 文章详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqArticleDetail = (params) => httpRequest.get('/protocol/detail', params);
